home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-serious-
/
programming
/
basic
/
mildred
/
lha
/
ilbmviewer.lha
/
ILBMviewer.ascii
< prev
next >
Wrap
Text File
|
1999-03-07
|
2KB
|
82 lines
WBStartup
;Main
DEFTYPE.w
INCLUDE "Prefs.bb2"
INCLUDE "Variables.bb2"
INCLUDE "Chunky.bb2"
INCLUDE "Display.bb2"
MReservec2pWindows 4
MReserveBitmaps 3
MaxLen ASLfile$=256
MaxLen ASLpath$=256
ASLpath$="Data:Pictures/IFF1"
FindScreen 0
Land$=ASLFileRequest$("Choose an ILBM picture)",ASLpath$,ASLfile$)
If InitLand{Land$,0,0,0}=False Then Goto Finish
YOff.l=(LandHeight-ILBMActualHeight)*LandWidth
ChunkyCopy16{LandBuffer+YOff,LandBuffer2+YOff,ILBMActualHeight,CPUminimum,LandWidth,LandWidth} ; Duplicate
If InitDisplay{"Game"}=False Then Goto Finish
ShowPalette 0
Multitasking{On}
buf.b=0
its.l=0
*Scr._Screen=Peek.l(Addr Screen(0))
xmult.q=(LandWidth-PrefDisplayWidth)/PrefDisplayWidth
ymult.q=(LandHeight-PrefDisplayHeight)/PrefDisplayHeight
LandX.w=0
LandY.w=0
MemOffset.l=0
Mc2pWindow 0,PrefDisplayWidth,PrefDisplayHeight,LandWidth,CPUminimum,PrefDisplayWidth,PrefDisplayHeight
MCPU CPUminimum
Mc2pCPUmode CPUminimum
ResetTimer
While Joyb(0)<>1 AND Joyb(1)=0
If PrefDisplayBuffering>1
buf+1
If buf=PrefDisplayBuffering Then buf=0
EndIf
LandX.w=SMouseX*xmult
LandY.w=SMouseY*ymult
If IsAGA
Mc2p c2pLaceMode,MBitmapPtr(LandX,LandY),PlanarBuf(buf)
ShowBitMap buf
Else
*RP._RastPort=RastPort(buf)
For Y=0 To PrefDisplayHeight-1
WritePixelLine8_ *RP,0,Y,PrefDisplayWidth-1,MBitmapPtr(LandX,LandY+Y),0
Next Y
*ScrVP\DyOffset=BufNum*PrefDisplayHeight
ScrollVPort_ *ScrVP
EndIf
its+1
Wend
t=Timer
t=Max(t,1)
its=Max(its,1)
a.q=50.0/(t/its)
ScreenToBack_ NPeekL(Addr Screen(0))
VWait 50
FindScreen 1
Window 2,16,16,300,40,0,"Test results",1,0
WindowOutput 2
NPrint a," frames per second"
NPrint " "
NPrint "Press mouse/joy button..."
Repeat
Until Joyb(0)<>0 OR Joyb(1)<>0
Finish:
Multitasking{On}
End